package com.fancy.learncenter.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by hyy on 2018/1/17.
 * describe as
 */

public class CartoonStudentSubjectiveDataBean implements Parcelable {
    /**
     * categoryId : 7(听音看词录音)8（多句录音） 9（看图说话） 10（唱歌） 11
     * categoryName : 句型跟读
     * questionName : Our World 1 Unit 2-Grammar 2
     * stemsList : [{"key":"subtitle_url","value":"http://img1.fancyedu.com/dev/homework/unit2/Our_World_1_Unit_2-Grammar_2.json"},{"key":"cover_img_url","value":"http://img1.fancyedu.com/dev/homework/unit2/Our_World_1_Unit_2-Grammar_2.png"},{"key":"video_url","value":"http://img1.fancyedu.com/dev/homework/unit2/Our_World_1_Unit_2-Grammar_2.mp4"},{"key":"video_duration","value":"143"},{"key":"img_url","value":"http://img1.fancyedu.com/dev/homework/unit2/Our_World_1_Unit_2-Grammar_2.png"}]
     * subjectQuestionId : 948866919135993858
     * subtitleJsonStr : [ {"index":0,"curStart":8487,"curEnd":9683,"translations":"A bird.","transcript":"A bird."},  {"index":1,"curStart":16696,"curEnd":18504,"translations":"Where is the bird?","transcript":"Where is the bird?"},  {"index":2,"curStart":22315,"curEnd":23717,"translations":"It's in the tree.","transcript":"It's in the tree."},  {"index":3,"curStart":31541,"curEnd":32491,"translations":"Birds.","transcript":"Birds."},  {"index":4,"curStart":39995,"curEnd":41613,"translations":"Where are the birds?","transcript":"Where are the birds?"},  {"index":5,"curStart":45236,"curEnd":46877,"translations":"They're in the tree.","transcript":"They're in the tree."},  {"index":6,"curStart":57485,"curEnd":59053,"translations":"A butterfly.","transcript":"A butterfly."},  {"index":7,"curStart":65820,"curEnd":67490,"translations":"Where is the butterfly?","transcript":"Where is the butterfly?"},  {"index":8,"curStart":71061,"curEnd":72702,"translations":"It's on the bush.","transcript":"It's on the bush."},  {"index":9,"curStart":80469,"curEnd":81821,"translations":"Butterflies.","transcript":"Butterflies."},  {"index":10,"curStart":88898,"curEnd":90759,"translations":"Where are the butterflies?","transcript":"Where are the butterflies?"},  {"index":11,"curStart":94155,"curEnd":95638,"translations":"They're on the bush.","transcript":"They're on the bush."},  {"index":12,"curStart":103626,"curEnd":104805,"translations":"A stone.","transcript":"A stone."},  {"index":13,"curStart":109309,"curEnd":110804,"translations":"Where is the stone?","transcript":"Where is the stone?"},  {"index":14,"curStart":114376,"curEnd":115870,"translations":"It's on the mountain.","transcript":"It's on the mountain."},  {"index":15,"curStart":121566,"curEnd":126286,"translations":"Stones, stones, stones.","transcript":"Stones, stones, stones."},  {"index":16,"curStart":127447,"curEnd":128947,"translations":"Where are the stones?","transcript":"Where are the stones?"},  {"index":17,"curStart":132193,"curEnd":133617,"translations":"They're on the mountain.","transcript":"They're on the mountain."},  {"index":18,"curStart":139277,"curEnd":142153,"translations":"And now, they're in the river!","transcript":"And now, they're in the river!"}]
     */

    private String categoryId;
    private String categoryName;
    private String questionName;
    private String subjectQuestionId;
    private String subtitleJsonStr;
    private List<StemsListBean> stemsList;

    protected CartoonStudentSubjectiveDataBean(Parcel in) {
        categoryId = in.readString();
        categoryName = in.readString();
        questionName = in.readString();
        subjectQuestionId = in.readString();
        subtitleJsonStr = in.readString();
        stemsList = in.createTypedArrayList(StemsListBean.CREATOR);
    }

    public static final Creator<CartoonStudentSubjectiveDataBean> CREATOR = new Creator<CartoonStudentSubjectiveDataBean>() {
        @Override
        public CartoonStudentSubjectiveDataBean createFromParcel(Parcel in) {
            return new CartoonStudentSubjectiveDataBean(in);
        }

        @Override
        public CartoonStudentSubjectiveDataBean[] newArray(int size) {
            return new CartoonStudentSubjectiveDataBean[size];
        }
    };

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getQuestionName() {
        return questionName;
    }

    public void setQuestionName(String questionName) {
        this.questionName = questionName;
    }

    public String getSubjectQuestionId() {
        return subjectQuestionId;
    }

    public void setSubjectQuestionId(String subjectQuestionId) {
        this.subjectQuestionId = subjectQuestionId;
    }

    public String getSubtitleJsonStr() {
        return subtitleJsonStr;
    }

    public void setSubtitleJsonStr(String subtitleJsonStr) {
        this.subtitleJsonStr = subtitleJsonStr;
    }

    public List<StemsListBean> getStemsList() {
        return stemsList;
    }

    public void setStemsList(List<StemsListBean> stemsList) {
        this.stemsList = stemsList;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(categoryId);
        parcel.writeString(categoryName);
        parcel.writeString(questionName);
        parcel.writeString(subjectQuestionId);
        parcel.writeString(subtitleJsonStr);
        parcel.writeTypedList(stemsList);
    }

    public static class StemsListBean implements Parcelable {
        /**
         * key : subtitle_url
         * value : http://img1.fancyedu.com/dev/homework/unit2/Our_World_1_Unit_2-Grammar_2.json
         */

        private String key;
        private String value;

        protected StemsListBean(Parcel in) {
            key = in.readString();
            value = in.readString();
        }

        public static final Creator<StemsListBean> CREATOR = new Creator<StemsListBean>() {
            @Override
            public StemsListBean createFromParcel(Parcel in) {
                return new StemsListBean(in);
            }

            @Override
            public StemsListBean[] newArray(int size) {
                return new StemsListBean[size];
            }
        };

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel parcel, int i) {
            parcel.writeString(key);
            parcel.writeString(value);
        }
    }
}
